import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/inspec/inspec_plan_entity.dart';

InspecPlanEntity $InspecPlanEntityFromJson(Map<String, dynamic> json) {
  final InspecPlanEntity inspecPlanEntity = InspecPlanEntity();
  final int? completedQuantity = jsonConvert.convert<int>(json['completedQuantity']);
  if (completedQuantity != null) {
    inspecPlanEntity.completedQuantity = completedQuantity;
  }
  final int? numberOfMissedDetections = jsonConvert.convert<int>(json['numberOfMissedDetections']);
  if (numberOfMissedDetections != null) {
    inspecPlanEntity.numberOfMissedDetections = numberOfMissedDetections;
  }
  final int? planTotalNum = jsonConvert.convert<int>(json['planTotalNum']);
  if (planTotalNum != null) {
    inspecPlanEntity.planTotalNum = planTotalNum;
  }
  final int? quantityInProgress = jsonConvert.convert<int>(json['quantityInProgress']);
  if (quantityInProgress != null) {
    inspecPlanEntity.quantityInProgress = quantityInProgress;
  }
  return inspecPlanEntity;
}

Map<String, dynamic> $InspecPlanEntityToJson(InspecPlanEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['completedQuantity'] = entity.completedQuantity;
  data['numberOfMissedDetections'] = entity.numberOfMissedDetections;
  data['planTotalNum'] = entity.planTotalNum;
  data['quantityInProgress'] = entity.quantityInProgress;
  return data;
}

extension InspecPlanEntityExtension on InspecPlanEntity {
  InspecPlanEntity copyWith({
    int? completedQuantity,
    int? numberOfMissedDetections,
    int? planTotalNum,
    int? quantityInProgress,
  }) {
    return InspecPlanEntity()
      ..completedQuantity = completedQuantity ?? this.completedQuantity
      ..numberOfMissedDetections = numberOfMissedDetections ?? this.numberOfMissedDetections
      ..planTotalNum = planTotalNum ?? this.planTotalNum
      ..quantityInProgress = quantityInProgress ?? this.quantityInProgress;
  }
}
